import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath, URL } from "node:url";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import vueDevTools from 'vite-plugin-vue-devtools'
import path from "path";
import tailwindcss from "@tailwindcss/vite";
// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    tailwindcss(),
    createSvgIconsPlugin({
      iconDirs: [path.resolve(process.cwd(), "src/assets/icon")],
      symbolId: "icon-[dir]-[name]",
    }),
    vueDevTools()
  ],
  resolve: {
    alias: [
      {
        find: "@",
        replacement: fileURLToPath(new URL("./src", import.meta.url)),
      },
    ],
  },
  server: {
    port: 8037,
    host: true,
    open: true,
     proxy: {
   
        '/fetch-api': {
          target: 'https://menxiaozheng.jingxizhigu.cn:8111',
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/fetch-api/, '')
        }
      }
  },
});
